// 路由器模块
import Vue from "vue";
import Router from "vue-router";

// import Msite from "../pages/Msite/Msite.vue";
// import Search from "../pages/Search/Search.vue";
// import Order from "../pages/Order/Order.vue";
// import Profile from "../pages/Profile/Profile.vue";

// 路由组件懒加载
const Msite = () =>
    import ('../pages/MSite/MSite.vue');
const Search = () =>
    import ('../pages/Search/Search.vue');
const Order = () =>
    import ('../pages/Order/Order.vue');
const Profile = () =>
    import ('../pages/Profile/Profile.vue');



import Login from "../pages/Login/Login.vue";
import Shop from "../pages/Shop/Shop";
import ShopGoods from "../pages/Shop/ShopGoods/ShopGoods.vue";
import ShopRatings from "../pages/Shop/ShopRatings/ShopRatings.vue";
import ShopInfo from "../pages/Shop/ShopInfo/ShopInfo.vue";

Vue.use(Router);

export default new Router({
    routes: [{
            path: "/",
            redirect: "/msite"
        },
        {
            path: "/msite",
            component: Msite,
            meta: {
                showFooter: true
            }
        },
        {
            path: "/search",
            component: Search,
            meta: {
                showFooter: true
            }
        },
        {
            path: "/order",
            component: Order,
            meta: {
                showFooter: true
            }
        },
        {
            path: "/profile",
            component: Profile,
            meta: {
                showFooter: true
            }
        },
        {
            path: "/login",
            component: Login
        },
        {
            path: "/shop",
            component: Shop,
            children: [{
                    path: "/shop/goods",
                    component: ShopGoods
                },
                {
                    path: "/shop/ratings",
                    component: ShopRatings
                },
                {
                    path: "/shop/info",
                    component: ShopInfo
                },
                {
                    path: "",
                    redirect: "/shop/goods"
                }
            ]
        }
    ]
});